<!-- 入驻列表 -->
<style>
    th {
        text-align: center;
    }
    .table>tbody>tr>td {
        line-height: 60px;
        text-align: center;
        height: 50px;
        margin: 0px;
        font-weight:normal;
    }
    #data_page .table>tbody>tr>td:last-child{
        text-align: center;
    }
    font{ margin: 0px auto;}
    #myModal .modal-dialog {
        width: 80%;
    }
    #orderinfo td{font-weight: normal !important}
</style>
<!-- css -->
<link href="__PUBLIC__/ganged/Css/bootstrap.css" rel="stylesheet" type="text/css" />

<div id="data_page" class="in_page">
    <div class="panel panel-default">
        <div class="panel-body">
            <form class="form-inline" method="get" name="keyword" id="keyword">
                <div class="form-group">
                    <input type="text" class="form-control" value="{:I('wd')}" name="wd" placeholder="名称">
                </div>
                <button type="submit" class="btn btn-sm btn-default">搜索</button>
                <div class="btn-group" role="group" aria-label="..." style="float:right;margin-right:20px">
                    <a href="{:U('add')}"><button type="button" class="btn btn-primary">添加</button></a>
                </div>
            </form>
        </div>
    </div>
    <table class="table table-striped table-bordered table-condensed">
        <thead>
            <tr>
                <th>商品名称</th>
                <th>排名</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <volist name="list" id="li">
                <tr>
                    <td>{$li.goods_name}</td>
                    <td>{$li.rank}</td>
                    <td>
                        <a href="{:U('edit', array('id'=>$li['id']))}">
                            <button type="button" class="btn btn-sm btn-success" >修改</button>
                        </a>
                        <!-- <button type="button" class="btn btn-sm btn-danger del" d_id="{$li.id}">删除</button> -->
                    </td>
                </tr>
            </volist>
        </tbody>
    </table>
</div>
<div>{$page}</div>
<script>
    $(function(){
        //删除店铺
        $(".del").click(function(obj){
            $_this = $(this);
            var id = $(this).attr("d_id");
            if(confirm("您确认删除吗?")){
                $.post("{:U('del')}", {'id':id},function(obj){
                    alert(obj.m);
                    if(obj.s){
                        $_this.parent().parent().remove();
                    }
                })
            }
            return false;
        });
    })
</script>
